import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.Sprite;


public class HeroSprite extends Sprite {

	public int currentX;
	public int currentY;
	
	private Image currentImage = null;
	
	public HeroSprite(Image image, int frameWidth, int frameHeight) {
		super(image, frameWidth, frameHeight);
	}

	public void setCurrentImage(Image image,int perWidth,int perHeight){
		System.out.println("[currentImage:" + currentImage +"]" + "[image:"+image+"]");
		
		if(null==this.currentImage || !image.equals(currentImage))
		{
			System.out.println("HeroSprite set new");
			currentImage = image;
			setImage(currentImage, perWidth, perHeight);			
		}
		nextFrame();
	}
	
}
